var Layout = (function(){
    var vmMenu = new Vue({
    	el:'#bs-example-navbar-collapse-1',
    	data:{
    		ariaExpanded:false,
    		height:0
    	}
    }
   )
   

    var vmMain = new Vue(
        {
            el:'#main',
            data:{
                marginTop:vmMenu.height+5
            }
        }
    )
    vmMenu.$watch('height', function (val) {
    	vmMain.marginTop = vmMenu.height + 5;
    })
    
    $('#collapsedBtn').click(function(){
    	//vmMenu.height = $('#bs-example-navbar-collapse-1').height();
    	var ariaExpanded = $('#bs-example-navbar-collapse-1').attr('aria-expanded');
    	if(ariaExpanded && ariaExpanded == 'true'){
    		vmMenu.height = 0;
    	}else{
    		vmMenu.height = 223;
    	}
    });
    
    $(window).resize(function(){
    	if(vmMenu.height > 0){
    		$('#bs-example-navbar-collapse-1').attr('aria-expanded','false');
    		$('#bs-example-navbar-collapse-1').height(0);
    		$('#bs-example-navbar-collapse-1').removeClass('in');
    		vmMenu.height =0;
    	}
    	
	});
})()